package business;

import org.apache.log4j.Logger;

// represent a user
// with account
public class User {
    // represent a inner wallet of the user
    private double _wallet;
    // represent a key of the user
    private int _id;
    // logger
    private static final Logger LOGGER = Logger.getLogger(User.class);

    // getter for id
    public int getId() {
        return _id;
    }
    // getter for user wallet (money count)
    public double getWallet() {
        return _wallet;
    }

    public User(int id) {
        _id = id;
    }

    public void increaseWallet(double value) {
        if (value < 0) {
            throw new IllegalArgumentException();
        }
        _wallet += value;
    }

    public void decreaseWallet(double value) {
        if (value < _wallet) {
            throw new IllegalArgumentException();
        }
        _wallet -= value;
    }
}
